package com.zryc.service;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
@Slf4j
//@RocketMQMessageListener(topic = "Order",consumerGroup = "yc23_shop_cons",selectorExpression = "CHECKOUT_SUCCESS")
public class MySmsService implements RocketMQListener<Map> {

    @Override
    public void onMessage(Map message) {
        log.info(message.toString());
        Map order= (Map) message.get("ORDER_INFO");
        log.info("接收到下单成功的信息，之后给该用户的手机终端发送一条下单成功的原因");
        log.info("用户"+order.get("username")+"购买了"+order.get("number")+"个"+order.get("pname"));
    }
}
